import request from '@/utils/request.js'

// 常量
const api_name = '/system/admin/user'

export default {
    getUserPage(params) {
        return request({
            url: `${api_name}/getUserPage`,
            method: 'get',
            params: params
        })
    },
    getUserDetailsById(id) {
        return request({
            url: `${api_name}/getUserDetailsById/${id}`,
            method: 'get'
        })
    },
    saveUser(data) {
        return request({
            url: `${api_name}/saveUser`,
            method: 'post',
            data: data
        })
    },
    updateUser(data) {
        return request({
            url: `${api_name}/updateUser`,
            method: 'post',
            data: data
        })
    },
    batchDeleteByIds(ids) {
        return request({
            url: `${api_name}/batchDeleteByIds`,
            method: 'post',
            data: ids
        })
    },
    assignRolesToUser(userId,roleIds) {
        return request({
            url: `${api_name}/assignRolesToUser/${userId}`,
            method: 'post',
            data: roleIds
        })
    },
    resetPasswordById(id) {
        return request({
            url: `${api_name}/resetPasswordById/${id}`,
            method: 'post'
        })
    },
}
